home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / FORTRAN.MIN < prev    next >
Text File  |  1991-08-29  |  22KB  |  868 lines

  1. -------------------------------------------------------------------------------
  2. Press C-c C-c (= M:done-editing) to install,
  3. then answer 'y' to write the changes to disk.
  4. -------------------------------------------------------------------------------
  5.  
  6. Name:Nfilename
  7. [*]fortran[*]
  8.  
  9. Name:N-Fortran-mode-description
  10. fortran.min - major mode for editing Fortran with Freemacs.
  11. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  12.  
  13.     Fortran mode is free software; you can redistribute it and/or modify
  14.     it under the terms of the GNU General Public License as published by
  15.     the Free Software Foundation; either version 1, or (at your option)
  16.     any later version.
  17.  
  18.     Fortran mode is distributed in the hope that it will be useful,
  19.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.     GNU General Public License for more details.
  22.  
  23.     You should have received a copy of the GNU General Public License
  24.     along with Fortran mode; if not, write to the Free Software
  25.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27. -------------------------------------------------------------------------------
  28.  
  29. This should really become a TeXinfo file, but nobody has volunteered
  30. to code TeXinfo-format-buffer in MINT yet. (Someday the Free Software
  31. Foundation might release the 'makeinfo' program.)
  32.  
  33. -------------------------------------------------------------------------------
  34.  
  35. Major mode for editing Fortran code with Freemacs:
  36. ==================================================
  37.  
  38.  
  39. Here we should write down some more documentation ....
  40.  
  41.  
  42. -------------------------------------------------------------------------------
  43.  
  44. Possible improvements: (PROBABLY in the next release, no promises)
  45.  
  46.   * make indentation faster.
  47.  
  48.   * implement indent-region.
  49.  
  50. -------------------------------------------------------------------------------
  51.  
  52. Credits:
  53.  
  54.    much inspiration came from the GNU Emacs Fortran mode.
  55.  
  56. -------------------------------------------------------------------------------
  57.  
  58. Functions: (invoked by M-x fun-name)
  59. ------------------------------------
  60.  
  61.   * Fortran-mode, for-mode
  62.     Switch to Fortran-mode
  63.  
  64.   * split-space
  65.     Supports fortran continuation and comment lines.
  66.  
  67.   * fortran-indent-line
  68.     Indent properly for fortran.
  69.  
  70.   * fortran-new-line
  71.     Newline and indent properly for fortran.
  72.  
  73.   * fortran-split-line
  74.     Force splitting of current line at point, taking care of continuation.
  75.  
  76.   * fortran-close-block
  77.     If there is an DO (resp. IF) on the current line,
  78.     insert the corresponding template.
  79.  
  80.   * fortran-column-ruler
  81.     Display a column ruler above current line.
  82.  
  83.   * newline
  84.     Insert a newline.
  85.  
  86.   * fortran-help
  87.     Give some help.
  88.  
  89.   * beginning-of-fortran-subprogram
  90.     Moves point to the beginning of the current fortran subprogram.
  91.  
  92.   * end-of-fortran-subprogram
  93.     Moves point to the end of the current fortran subprogram.
  94.  
  95.   * mark-fortran-subprogram
  96.     Put mark at end of fortran subprogram, point at beginning.
  97.  
  98.   * fortran-electric-line-number
  99.     Place line numbers in the right column.
  100.  
  101.   * question-mark
  102.     Insert a question mark or give help about abbrevs.
  103.  
  104.   * list-fortran-abbrevs
  105.     Display the list of currently defined abbrevs.
  106.  
  107.   * fortran-version
  108.     Echo the current RCS Header of the mint file.
  109.  
  110.  
  111. Special abbrevs (magic numbers):
  112.   * al:  137.03599d0
  113.     (1/fine-structure-constant)
  114.   * ga:  0.577215664901532861d0
  115.     (Euler's constant)
  116.   * hc:  197.3271d0
  117.     (h-bar*c in MeV fm)
  118.   * hc2: 0.3893797d0
  119.     (h-bar*c squared in GeV mbarn)
  120.   * pi:  3.141592653589793238d0
  121.     (everybody knows this ...)
  122.     Values taken from 'Review of Particle Properties' (1988)
  123. Locally redefined keys:
  124. -----------------------
  125.  
  126.   *          (split-space)
  127.   * 0,..,9    (fortran-electric-line-number)
  128.   * ?        (question-mark)
  129.   * Tab        (fortran-indent-line)
  130.   * Return    (newline)
  131.   * C-Return    (fortran-new-line)
  132.   * M-Return    (fortran-split-line)
  133.   * C-c a    (list-fortran-abbrevs)
  134.   * C-c C-h    (fortran-help)
  135.   * M-C-a    (beginning-of-fortran-subprogram)
  136.   * M-C-e    (end-of-fortran-subprogram)
  137.   * M-C-h    (mark-fortran-subprogram)
  138.   * C-c C-r    (fortran-column-ruler)
  139.   * C-c C-f    (fortran-close-block)
  140.   * C-c v    (fortran-version)
  141.  
  142.  
  143. Configuration variables:
  144. ------------------------
  145.  
  146.   * N-fortran-do-indent
  147.     Amount on indentation of 'do' loops
  148.     Default: 3
  149.  
  150.   * N-fortran-if-indent
  151.     Amount on indentation of 'if' blocks.
  152.     Default: 3
  153.  
  154.   * N-fortran-continuation-indent
  155.     Extra indentation of continuation lines.
  156.     Default: 5
  157.  
  158.   * N-fortran-continuation-char
  159.     Character which is inserted to begin a continuation line.
  160.     Default: $
  161.  
  162.   * N-fortran-abbrev-char
  163.     Character to introduce static abbreviations.
  164.     Default: ;
  165.  
  166.   * N-fortran-electric-line-number
  167.     Electric line numbers are active if this variable is non-nil.
  168.     Default: Y
  169.  
  170.   * N-fortran-startup-message
  171.     Set to nil to inhibit message first time Fortran-mode is used.
  172.  
  173.  
  174. -------------------------------------------------------------------------------
  175.  
  176. If you find bugs or miss a feature, please feel free to contact the
  177. author: Thorsten Ohl, td12@ddagsi3.bitnet.  (If you're not on the net:
  178. Jahnstrasse 80, 6100 Darmstadt, F.R.G.)
  179.  
  180. I can make no promises, but if you notify me of a bug, chances are much
  181. better that it will be fixed in a future release. Please quote always the
  182. version of Fortran mode you're working with. (Use C-c v if you're in
  183. Fortran mode or see below.)
  184.  
  185. -------------------------------------------------------------------------------
  186.  
  187. Revision information:
  188.  
  189.     $Source: c:/emacs/RCS/fortran.m'v $
  190.     $Revision: 1.4.1.1 $
  191.     $Date: 90/07/10 01:06:11 $
  192.     $Author: tho $
  193.  
  194. [*]dummy[*]
  195.  
  196.  
  197. -------------------------------------------------------------------------------
  198. 'style' parameters:
  199. -------------------------------------------------------------------------------
  200.  
  201. Name:N-fortran-do-indent
  202. Amount on indentation of 'do' loops
  203. [*]3[*]
  204.  
  205. Name:N-fortran-if-indent
  206. Amount on indentation of 'if' blocks.
  207. [*]3[*]
  208.  
  209. Name:N-fortran-continuation-char
  210. Character which is inserted to begin a continuation line.
  211. [*]$[*]
  212.  
  213. Name:N-fortran-continuation-indent
  214. Extra indentation of continuation lines.
  215. [*]5[*]
  216.  
  217. Name:N-fortran-abbrev-char
  218. Character to introduce static abbreviations.
  219. [*];[*]
  220.  
  221. Name:N-fortran-electric-line-number
  222. Electric line numbers are active if this variable is non-nil.
  223. [*]Y[*]
  224.  
  225. Name:N-fortran-startup-message
  226. Set to nil to inhibit message first time Fortran-mode is used.
  227. [*](major mode for editing Fortran with Freemacs.
  228. Copyright (C) 1989, 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  229.  
  230. use `C-c C-h' for quick help and `F1 m' for detailed information.
  231.  
  232. )[*]
  233.  
  234. Name:N-RCS-Id
  235. [*]$Header: c:/emacs/RCS/fortran.m'v 1.4.1.1 90/07/10 01:06:11 tho Exp $[*]
  236.  
  237. -------------------------------------------------------------------------------
  238. abbrevs:
  239. -------------------------------------------------------------------------------
  240.  
  241. Name:N$al
  242. 1/alpha
  243. Value from 'Review of Particle Properties' (1988)
  244. [*]137.03599d0[*]
  245.  
  246. Name:N$ga
  247. Euler's constant
  248. Value from 'Review of Particle Properties' (1988)
  249. [*]0.577215664901532861d0[*]
  250.  
  251. Name:N$hc
  252. h-bar*c (MeV fm)
  253. Value from 'Review of Particle Properties' (1988)
  254. [*]197.3271d0[*]
  255.  
  256. Name:N$hc2
  257. (h-bar*c)**2 (GeV mbarn)
  258. Value from 'Review of Particle Properties' (1988)
  259. [*]0.3893797d0[*]
  260.  
  261. Name:N$pi
  262. Value from 'Review of Particle Properties' (1988)
  263. [*]3.141592653589793238d0[*]
  264.  
  265. Name:N$b
  266. [*]byte[*]
  267.  
  268. Name:N$ch
  269. [*]character[*]
  270.  
  271. Name:N$cl
  272. [*]close[*]
  273.  
  274. Name:N$c
  275. [*]continue[*]
  276.  
  277. Name:N$cm
  278. [*]common[*]
  279.  
  280. Name:N$cx
  281. [*]complex[*]
  282.  
  283. Name:N$di
  284. [*]dimension[*]
  285.  
  286. Name:N$do
  287. [*]double[*]
  288.  
  289. Name:N$dc
  290. [*]double complex[*]
  291.  
  292. Name:N$dp
  293. [*]double precision[*]
  294.  
  295. Name:N$dw
  296. [*]do while[*]
  297.  
  298. Name:N$e
  299. [*]else[*]
  300.  
  301. Name:N$ed
  302. [*]enddo[*]
  303.  
  304. Name:N$el
  305. [*]elseif[*]
  306.  
  307. Name:N$en
  308. [*]endif[*]
  309.  
  310. Name:N$eq
  311. [*]equivalence[*]
  312.  
  313. Name:N$ex
  314. [*]external[*]
  315.  
  316. Name:N$ey
  317. [*]entry[*]
  318.  
  319. Name:N$f
  320. [*]format[*]
  321.  
  322. Name:N$fu
  323. [*]function[*]
  324.  
  325. Name:N$g
  326. [*]goto[*]
  327.  
  328. Name:N$im
  329. [*]implicit[*]
  330.  
  331. Name:N$ib
  332. [*]implicit byte[*]
  333.  
  334. Name:N$ic
  335. [*]implicit complex[*]
  336.  
  337. Name:N$ich
  338. [*]implicit character[*]
  339.  
  340. Name:N$ii
  341. [*]implicit integer[*]
  342.  
  343. Name:N$il
  344. [*]implicit logical[*]
  345.  
  346. Name:N$ir
  347. [*]implicit real[*]
  348.  
  349. Name:N$inc
  350. [*]include[*]
  351.  
  352. Name:N$in
  353. [*]integer[*]
  354.  
  355. Name:N$intr
  356. [*]intrinsic[*]
  357.  
  358. Name:N$l
  359. [*]logical[*]
  360.  
  361. Name:N$op
  362. [*]open[*]
  363.  
  364. Name:N$pa
  365. [*]parameter[*]
  366.  
  367. Name:N$pr
  368. [*]program[*]
  369.  
  370. Name:N$p
  371. [*]print[*]
  372.  
  373. Name:N$re
  374. [*]real[*]
  375.  
  376. Name:N$r
  377. [*]read[*]
  378.  
  379. Name:N$rt
  380. [*]return[*]
  381.  
  382. Name:N$rw
  383. [*]rewind[*]
  384.  
  385. Name:N$s
  386. [*]stop[*]
  387.  
  388. Name:N$su
  389. [*]subroutine[*]
  390.  
  391. Name:N$ty
  392. [*]type[*]
  393.  
  394. Name:N$w
  395. [*]write[*]
  396.  
  397. -------------------------------------------------------------------------------
  398. initialization:
  399. -------------------------------------------------------------------------------
  400.  
  401. Name:F:Fortran-mode
  402. Switch to Fortran-mode, i.e. enable Fortran-specific extensions.
  403. [*]#(Fexit-mode)
  404. #(n?,Nfilename,,(
  405.         #(Fload-lib,fortran)
  406. ))#(N!Fortran-mode)
  407. [*]
  408.  
  409. Name:F:for-mode
  410. Synonym for Fortran-mode
  411. [*]#(F:Fortran-mode)[*]
  412.  
  413. Name:N!Fortran-mode
  414. Meaty part of F:Fortran-mode.
  415. [*]#(Flocal-bind-key,K.M-C-a,N:beginning-of-fortran-subprogram)
  416. #(Flocal-bind-key,K.M-C-e,N:end-of-fortran-subprogram)
  417. #(Flocal-bind-key,K.M-C-h,N:mark-fortran-subprogram)
  418. #(Flocal-bind-key,K.C-c C-r,N:fortran-column-ruler)
  419. #(Flocal-bind-key,K.C-c C-f,N:fortran-close-block)
  420. #(Flocal-bind-key,K.C-c C-h,N:fortran-help)
  421. #(Flocal-bind-key,K.C-c a,N:list-fortran-abbrevs)
  422. #(Flocal-bind-key,K.C-c v,N:fortran-version)
  423. #(Flocal-bind-key,K.Tab,N:fortran-indent-line)
  424. #(Flocal-bind-key,K.C-Return,N:fortran-new-line)
  425. #(Flocal-bind-key,K.M-Return,N:fortran-split-line)
  426. #(Flocal-bind-key,K.Return,N:newline)
  427. #(Flocal-bind-key,K. ,N:split-space)
  428. #(Flocal-bind-key,K.?,N:question-mark)
  429. #(Flocal-bind-key,F-left-comment,c )
  430. #(Flocal-bind-key,F-prefix-comment,c )
  431. #(Flocal-bind-key,F-right-comment,)
  432. #(Flocal-bind-key,F-fill-column,72)
  433. #(Flocal-bind-key,K.0,N:fortran-electric-line-number(,)0)
  434. #(Flocal-bind-key,K.1,N:fortran-electric-line-number(,)1)
  435. #(Flocal-bind-key,K.2,N:fortran-electric-line-number(,)2)
  436. #(Flocal-bind-key,K.3,N:fortran-electric-line-number(,)3)
  437. #(Flocal-bind-key,K.4,N:fortran-electric-line-number(,)4)
  438. #(Flocal-bind-key,K.5,N:fortran-electric-line-number(,)5)
  439. #(Flocal-bind-key,K.6,N:fortran-electric-line-number(,)6)
  440. #(Flocal-bind-key,K.7,N:fortran-electric-line-number(,)7)
  441. #(Flocal-bind-key,K.8,N:fortran-electric-line-number(,)8)
  442. #(Flocal-bind-key,K.9,N:fortran-electric-line-number(,)9)
  443. #(Fset-modename,Fortran)
  444. #(Fenter-minor-mode,Fill)
  445. #(Fenter-minor-mode,Abbrev)
  446. [*]
  447.  
  448. Name:N&setup
  449. [*]#(==,##(N-fortran-startup-message),,,(
  450.     #(xy,0,0)
  451.     #(ow,#(N-fortran-startup-message))
  452.     #(Fmode-line)
  453.     #(Fhit-any-key)
  454. ))[*]
  455.  
  456. -------------------------------------------------------------------------------
  457. give help:
  458. -------------------------------------------------------------------------------
  459.  
  460. Name:N-fortran-help-screen
  461. [*](Special keys in the Fortran mode:
  462. ------------------------------------------------
  463.  
  464. indent properly:            Tab
  465. goto beginning of fortran subprogram:    M-C-a
  466. goto end of fortran subprogram:        M-C-e
  467. mark fortran subprogram:        M-C-h
  468. new line (with indentation):        C-Return
  469. split line (with continuation):        M-Return
  470. close Fortran block (IF & DO)        C-c C-f
  471. introduce abbreviation:            ;
  472.  
  473. help (this screen):            C-c C-h
  474. column ruler:                C-c C-r
  475. describe Fortran mode:            F1 m
  476. display abbrevs:            C-c a
  477. show revision of fortran mode:        C-c v
  478.  
  479. )
  480. [*]
  481.  
  482. Name:N:fortran-help
  483. Give some help.
  484. [*]#(ow,#(N-fortran-help-screen))
  485. #(Fhit-any-key)
  486. [*]
  487.  
  488. Name:N:fortran-version
  489. Echo the current RCS Header of the mint file.
  490. [*]#(an,#(N-RCS-Id))[*]
  491.  
  492. -------------------------------------------------------------------------------
  493. tabbing etc.:
  494. -------------------------------------------------------------------------------
  495.  
  496. Name:N:fortran-indent-line
  497. Indent properly for fortran.  (If not on a comment line)
  498. [*]#(lp,^[Cc\*],,R)
  499. #(l?,^,.,,,,(
  500.     #(lp,^[ (    )]*#(Fregexp-quote,#(N-fortran-continuation-char)),,R)
  501.     #(l?,^,$,,,(
  502.         #(sp,^)
  503.         #(F:kill-spaces)
  504.         #(Fpad-to-column,6)
  505.         #(sp,>)
  506.         #(F:kill-spaces)
  507.         #(Fpad-to-column,
  508.             #(++,#(Nindentation),#(N-fortran-continuation-indent)))
  509.     ),(
  510.         #(F:kill-spaces)
  511.         #(sp,^)
  512.         #(Uforward-skip,Uwhitep)
  513.         #(Uforward-skip,Udigitp)
  514.         #(Nwrite-label,#(rm,{)#(dm,^))
  515.         #(F:kill-spaces)
  516.         #(Fpad-to-column,#(Nindentation))
  517.     ))
  518. ))[*]
  519.  
  520. Name:N:fortran-new-line
  521. Newline and indent properly for fortran.
  522. [*]#(Fin-minor-mode,Abbrev,(#(Nexpand-fortran-abbrev)))
  523. #(Fin-minor-mode,Spell,(#(F:spell-word)))
  524. #(sp,$)#(Fcrlf)
  525. #(Fpad-to-column,#(Nindentation))
  526. [*]
  527.  
  528. Name:Nline-head
  529. Returns the beginning of the current line.
  530. [*]#(pm,2)#(sm,0)
  531. #(sp,^)
  532. #(Fforward-skip-nonwhite)#(Fforward-skip-white)
  533. #(rm,^)
  534. #(sp,0)#(pm)
  535. [*]
  536.  
  537. Name:N:fortran-split-line
  538. Force splitting of current line at point, taking care of continuation.
  539. [*]#(Fin-minor-mode,Abbrev,(#(Nexpand-fortran-abbrev)))
  540. #(Fin-minor-mode,Spell,(#(F:spell-word)))
  541. #(lp,^[Cc\*],,R)
  542. #(l?,.,^,,,(#(is,#(Nline-head)#(Fcrlf))),
  543.        (#(Fcrlf)#(is,     ##(N-fortran-continuation-char))
  544.         #(Fpad-to-column,#(++,
  545.             #(Nindentation),
  546.             #(N-fortran-continuation-indent)))
  547.        )
  548. )
  549. [*]
  550.  
  551. Name:N:split-space
  552. Supports fortran continuation and comment lines (and only those)
  553. [*]#(Fin-minor-mode,Abbrev,(#(Nexpand-fortran-abbrev)))
  554. #(Fin-minor-mode,Spell,(#(F:spell-word)))
  555. #(Fself-insert, )
  556. #(Fin-minor-mode,Fill,(
  557.     #(g?,##(lv,cs),##(gs,F-fill-column),(
  558.         #(pm,1)
  559.         #(sm,0,<)
  560.         #(sv,cs,##(gs,F-fill-column))
  561.         #(Fbackward-skip-nonwhite)
  562.         #(Fbackward-delete-whitespace)
  563.         #(N:fortran-split-line)
  564.         #(sp,0>)
  565.         #(pm)
  566.     ))
  567. ))[*]
  568.  
  569. Name:N:newline
  570. Insert a newline.
  571. [*]#(Fin-minor-mode,Abbrev,(#(Nexpand-fortran-abbrev)))
  572. #(Fin-minor-mode,Spell,(#(F:spell-word)))
  573. #(Fcrlf)[*]
  574.  
  575. -------------------------------------------------------------------------------
  576. dynamical abbreviation:
  577. -------------------------------------------------------------------------------
  578.  
  579. Name:N:fortran-close-block
  580. If there is an DO (resp. IF) on the current line, place the corresponding
  581. CONTINUE (resp. ELSE ENDIF) with the right indentation two lines below.
  582. Write label (resp. THEN). Cases are folded automatically.
  583. [*]#(pm,3)
  584. #(lp,^[ (    )]*DO[(    ) ]*,,R,F)
  585. #(l?,$,^,1,2,(
  586.         #(sp,2)
  587.             #(ds,N-label,#(rm,}))
  588.         #(sp,1+)
  589.             #(Nset-indent)
  590.         #(sp,$)
  591.             #(Fcrlf)#(Fcrlf)
  592.             #(Nwrite-label,#(N-label))
  593.                       #(Nalign,continue,#(N-fortran-do-indent))
  594.     ),(
  595.         #(lp,^[ (    )]*IF[ ##(bc,40,d,a)],,R,F)
  596.         #(l?,$,^,1,,(
  597.                 #(sp,1+)
  598.                     #(Nset-indent)
  599.                 #(sp,$)
  600.                     #(is, #(Nfold,then))
  601.                     #(Fcrlf)#(Fcrlf)
  602.                               #(Nalign,endif,#(N-fortran-if-indent))
  603.                     #(Fcrlf)
  604.                               #(Nalign,else,#(N-fortran-if-indent))
  605.             ),(
  606.                 #(an,No block starts on this line!)
  607.             ))
  608.     ))
  609. #(pm)
  610. [*]
  611.  
  612. -------------------------------------------------------------------------------
  613. 'subroutines':
  614. -------------------------------------------------------------------------------
  615.  
  616. Name:Npull-mark-regex
  617. #(Npull-mark-regex,RE,S,E,Y,N)
  618. Search for regular expression RE (case insensitive) between
  619. S and E. If successful, set E to the beginning of the
  620. matching string, and return Y; else return N.
  621. [*]#(lp,arg1,,R,F)#(l?,arg2,arg3,arg3,,(arg4),(arg5))[*]
  622. [*]
  623.  
  624. Name:Nindentation
  625. Returns the current indentation, according to nested DO-loops or
  626. IF-blocks. Works only if each DO-loop is ended by a CONTINUE
  627. (which is anyway good fortran style). Knows about the 7th column.
  628. -----------------------------------------------------------------
  629. Although this routine is faster than my first trials, it is
  630. still to slow for non-16-Mhz PCs. Somebody could find a
  631. way without regular expressions ...
  632. [*]#(pm,2)#(sm,0)#(sm,1,[)
  633. #(Npull-mark-regex,(^[(    ) 0-9]*continue$),0,1,
  634.         (#(sp,1+}+)))
  635. #(Npull-mark-regex,(^[(    ) ]*endif$),0,1,
  636.         (#(sp,1+)))
  637. #(Npull-mark-regex,(^[(    ) ]*do[ (    )]),0,1,
  638.         (#(sp,1+#(Floop,>,#(N-fortran-do-indent)))))
  639. #(Npull-mark-regex,(^[(    ) ]*if[ (    )##(bc,40,d,a)].*then),0,1,
  640.         (#(sp,1+#(Floop,>,#(N-fortran-if-indent)))))
  641. #(g?,7,#(lv,cs),7,(#(lv,cs)))
  642. #(sp,0)#(pm)
  643. [*]
  644.  
  645. Name:Nset-indent
  646. Determines the case of the character under the point,
  647. writes the current indentation to #(N-white), and aligns
  648. the opening line of the structure.
  649. Assumes to sit on the first letter of the DO of IF.
  650. [*]
  651. #(ds,N-case,#(rm,>))
  652. #(ds,N-white,#(Nindentation))
  653. #(dm,^)
  654. #(Fpad-to-column,#(N-white))
  655. [*]
  656.  
  657. Name:Nfold
  658. Return arg1 (folded according to #(N-case)).
  659. [*]#(a?,#(N-case),[,(#(si,Fxlat-upper,arg1)),(#(si,Fxlat-lower,arg1)))[*]
  660.  
  661. Name:Nalign
  662. Insert arg1 (folded according to #(N-case)), indented by #(N-white), then
  663. move up one line and indent by #(N-white) + arg2.
  664. [*]#(Fpad-to-column,#(N-white))
  665. #(is,#(Nfold,arg1))
  666. #(sp,^<)
  667. #(Fpad-to-column,#(++,#(N-white),arg2))
  668. [*]
  669.  
  670. Name:Nwrite-label
  671. Inserts arg1 like labels in Fortran should look.
  672. (assumes .=^).
  673. [*]#(Fpad-to-column,#(--,6,#(nc,arg1)))
  674. #(is,arg1)
  675. [*]
  676.  
  677. -------------------------------------------------------------------------------
  678. Digitally remastered GNU emacs:
  679. -------------------------------------------------------------------------------
  680.  
  681. Name:N:beginning-of-fortran-subprogram
  682. Moves point to the beginning of the current fortran subprogram.
  683. [*]#(pm,2)#(sm,0)#(sm,1,[)
  684. #(Npull-mark-regex,^[ (    )a-z]*function ,0,1,(#(sp,1+)))
  685. #(Npull-mark-regex,^[ (    )]*subroutine ,0,1,(#(sp,1+)))
  686. #(Npull-mark-regex,^[ (    )]*program ,0,1,(#(sp,1+)))
  687. #(==,#(rc,0),0,(#(an,First subprogram!)))
  688. #(pm)
  689. [*]
  690.  
  691. Name:N:end-of-fortran-subprogram
  692. Moves point to the end of the current fortran subprogram.
  693. [*]#(pm,2)#(sm,0)#(sm,1,])
  694. #(Npull-mark-regex,^[ (    )]*end$,0,1,(#(sp,1+)))
  695. #(==,#(rc,0),0,(#(an,Last subprogram!)))
  696. #(pm)
  697. [*]
  698.  
  699. Name:N:mark-fortran-subprogram
  700. Put mark at end of fortran subprogram, point at beginning.
  701. The marks are pushed.
  702. [*]#(N:end-of-fortran-subprogram)#(sp,$>)
  703. #(F:set-mark-command)
  704. #(N:beginning-of-fortran-subprogram)#(sp,^)
  705. [*]
  706.  
  707. Name:N-fortran-column-ruler
  708. Used by fortran-column-ruler.
  709. [*](0---4-6--10----*---20----*---30----*---40----*---50----*---60----*---70
  710. [---]|{---|----|----|----|----|----|----|----|----|----|----|----|----|})
  711. [*]
  712.  
  713. Name:N:fortran-column-ruler
  714. Inserts a column ruler momentarily above current line, till next keystroke.
  715. The ruler is defined by the value of N-fortran-column-ruler.
  716. The key typed is executed unless it is SPC.
  717. [*]
  718. #(xy,0,#(--,#(lv,rs),3))
  719. #(ow,#(N-fortran-column-ruler))
  720. #(ds,temp,#(g))
  721. #(==,##(temp), ,,(
  722.     #(Fkbd-in,##(temp))
  723. ))
  724. [*]
  725.  
  726.  
  727. Name:Nexpand-fortran-abbrev
  728. Expand the non-white characters to the left of point, if they begin with
  729. #(N-fortran-abbrev-char), which is usually `;', from GNU Emacs.
  730. Insert the result.
  731. [*]#(pm,1)#(sp,{)
  732. #(==,##(N-fortran-abbrev-char),##(rm,<),(
  733.     #(Nexpand-fortran-abbrev-do,##(rm,}))
  734. ))
  735. #(sp,0)
  736. #(pm)[*]
  737.  
  738. Name:Nexpand-fortran-abbrev-do
  739. Expand arg1 properly case folded as fortran abbrev
  740. [*]#(ds,temp,N$##(si,Fxlat-lower,arg1))
  741. #(n?,##(temp),(
  742.     #(dm,<)
  743.     #(is,#(a?,arg1,a,(
  744.         ##(si,Fxlat-upper,##(##(temp)))
  745.     ),(
  746.         ##(N$arg1)
  747.     )))
  748.     #(dm,})
  749. ),(
  750.     #(bl)
  751. ))[*]
  752.  
  753. Name:N:question-mark
  754. Insert a question mark or give help about abbrevs.
  755. [*]#(Fin-minor-mode,Abbrev,
  756.     (#(==,##(N-fortran-abbrev-char),##(rm,<),
  757.         (#(N:list-fortran-abbrevs)),
  758.         (#(Fself-insert,?)))),
  759.     (#(Fself-insert,?)))
  760. [*]
  761.  
  762. Name:N:list-fortran-abbrevs
  763. Display the list of currently defined abbrevs.
  764. [*]#(ds,@N$,##(sa,#(ls,(,),N$)))
  765. #(fm,@N$,(,)N$)
  766. #(ds,temp,
  767. The following abbrevs are available in Fortran-mode:(,)
  768. ----------------------------------------------------(,)
  769. #(Nscan-fortran-abbrevs))
  770. #(Fmore)
  771. #(es,@N$)
  772. [*]
  773.  
  774. Name:Nscan-fortran-abbrevs
  775. Recursively scan the list of abbrevs and format them for #(Fmore).
  776. [*]#(ds,-temp,##(fm,@N$,(,)N$))
  777. #(==,##(-temp),,,(##(Nshow-abbrev-expansion,##(-temp))(,)#(SELF)))
  778. [*]
  779.  
  780. Name:Nshow-abbrev-expansion
  781. [*]((    )arg1(    )#(N$arg1))[*]
  782.  
  783. -------------------------------------------------------------------------------
  784. electric line numbers.
  785. -------------------------------------------------------------------------------
  786.  
  787. Name:N:fortran-electric-line-number
  788. Inspired by GNU Emacs.
  789. [*]#(Fself-insert,(arg1))
  790. #(==,#(N-fortran-electric-line-number),,,(
  791.     #(==,#(Nfortran-line-numberp,Y),,,(
  792.         #(sp,^+})
  793.         #(g?,6,#(rc,{),(
  794.                 #(Nwrite-label,#(rm,{)#(dm,^))
  795.                 #(N:fortran-indent-line)
  796.                 #(sp,-)
  797.             ),(
  798.                 #(dm,<)
  799.                 #(F:ring-the-bell)
  800.                 #(an,Line number to long!)
  801.             ))
  802.     ))
  803. ))
  804. [*]
  805.  
  806. Name:Nfortran-line-numberp
  807. #(Nfortran-line-numberp,Y,N) returns `Y' if point is on (or just behind) a
  808. Fortran line number, else `N' is returned.
  809. [*]#(pm,2)#(sm,0)#(lp,^[ (    )]*[0-9]*,,R)
  810. #(l?,^,$,,1,(
  811.         #(sp,})
  812.         #(==,#(rc,1),0,(arg1),(arg2))
  813.         #(sp,0)
  814.     ),(
  815.         (arg2)
  816.     ))
  817. #(pm)
  818. [*]
  819.  
  820. ----------------------------------------------------------------------
  821. point moving functions for the common user library:
  822. ----------------------------------------------------------------------
  823.  
  824. Name:Uforward-skip
  825. Skip all characters C to the right of point, for which #((arg1),C,Y,N)
  826. returns Y.
  827. [*]#(==,##(rc,]),0,,(
  828.     #((arg1),##(rm,>),(
  829.         #(sp,>)
  830.         #(SELF,(arg1))
  831.     ))
  832. ))[*]
  833.  
  834. Name:Ubackward-skip
  835. Skip all characters C to the left of point, for which #((arg1),C,Y,N)
  836. returns Y.
  837. [*]#(==,##(rc,[),0,,(
  838.     #(sp,<)
  839.     #((arg1),##(rm,>),(
  840.             #(SELF,(arg1))
  841.         ),(
  842.             #(sp,>)
  843.         ))
  844. ))[*]
  845.  
  846. Name:Udigitp
  847. #(Udigitp,C,Y,N) returns Y if C is a digit, N else.
  848. [*]#(a?,(arg1),9,(
  849.         #(a?,0,(arg1),(arg2),(arg3))
  850.     ),(
  851.         arg3
  852. ))[*]
  853.  
  854. Name:Uwhitep
  855. #(Uwhitep,C,Y,N) returns Y if C is a blank or tab, N else.
  856. [*]#(==,(arg1), ,(
  857.         arg2
  858.     ),(
  859.         #(==,(arg1),(    ),(arg2),(arg3))
  860. ))[*]
  861.  
  862. Name:Fautoload-N
  863. [*]fortran[*]
  864.  
  865. -------------------------------------------------------------------------------
  866. that's it.
  867. -------------------------------------------------------------------------------
  868.